package com.zjol

import scala.collection.mutable.ArrayBuffer
import scala.util.Sorting

/**
  * Created by Administrator on 2017/3/27.
  */
object arrayOp   {


  def main(args: Array[String]): Unit = {

    var num=Array(1,2,3,45)
    var name:Array[String]=Array("name","zhao")
    name(1)="zhaochao"

    num(1)=3

    println(num.toList)


    var buf=ArrayBuffer(1,2,3)

    buf(0)=4

    println(buf)





    var c=Array(1,2,3,4,5,6)



    var result=for (i<-c) yield i*2
    println(result.toList)

    var  d=c.filter(_%2==0).map(2*_)

    println(d.toList)

    var s=Array(1,2,3,2,6,3,2)
    var  sortS=Sorting.quickSort(s)

    println(s.toList)



  }


}
